package com.atguigu.springboot.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

// @RestController
public class DemoController {

    @Value("${server.port}")
    private int port;

    @Value("${server.servlet.context-path}")
    private String contextPath;

    @Value("${spring.application.name}")
    private String appName;

    @GetMapping("/my/component/scan")
    public String hello() {
        System.out.println("port = " + port);
        System.out.println("contextPath = " + contextPath);
        System.out.println("appName = " + appName);

        return "Hello!SpringBoot!~~~~~~~~2222222222222222";
    }

}
